package com.ruoyi.purchase.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.ProcOrderDetailMapper;
import com.ruoyi.purchase.domain.ProcOrderDetail;
import com.ruoyi.purchase.service.IProcOrderDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class ProcOrderDetailServiceImpl implements IProcOrderDetailService 
{
    @Autowired
    private ProcOrderDetailMapper procOrderDetailMapper;

    /**
     * 查询采购订单明细
     * 
     * @param detailId 采购订单明细主键
     * @return 采购订单明细
     */
    @Override
    public ProcOrderDetail selectProcOrderDetailByDetailId(Long detailId)
    {
        return procOrderDetailMapper.selectProcOrderDetailByDetailId(detailId);
    }

    /**
     * 查询采购订单明细列表
     * 
     * @param procOrderDetail 采购订单明细
     * @return 采购订单明细
     */
    @Override
    public List<ProcOrderDetail> selectProcOrderDetailList(ProcOrderDetail procOrderDetail)
    {
        return procOrderDetailMapper.selectProcOrderDetailList(procOrderDetail);
    }

    /**
     * 新增采购订单明细
     * 
     * @param procOrderDetail 采购订单明细
     * @return 结果
     */
    @Override
    public int insertProcOrderDetail(ProcOrderDetail procOrderDetail)
    {
        return procOrderDetailMapper.insertProcOrderDetail(procOrderDetail);
    }

    /**
     * 修改采购订单明细
     * 
     * @param procOrderDetail 采购订单明细
     * @return 结果
     */
    @Override
    public int updateProcOrderDetail(ProcOrderDetail procOrderDetail)
    {
        return procOrderDetailMapper.updateProcOrderDetail(procOrderDetail);
    }

    /**
     * 批量删除采购订单明细
     * 
     * @param detailIds 需要删除的采购订单明细主键
     * @return 结果
     */
    @Override
    public int deleteProcOrderDetailByDetailIds(String detailIds)
    {
        return procOrderDetailMapper.deleteProcOrderDetailByDetailIds(Convert.toStrArray(detailIds));
    }

    /**
     * 删除采购订单明细信息
     * 
     * @param detailId 采购订单明细主键
     * @return 结果
     */
    @Override
    public int deleteProcOrderDetailByDetailId(Long detailId)
    {
        return procOrderDetailMapper.deleteProcOrderDetailByDetailId(detailId);
    }
}
